package io;

import java.io.File;

public class SearchFolder {

	/**
	 * @param args
	 * @see <a
	 *      href="http://www.cnblogs.com/rollenholt/archive/2011/09/11/2173787.html">参考文档</a>
	 */
	public static void main(String[] args) {
		File file = new File(CreateFolder.foldername);
		print(file);
	}
	private static void print(File f){
		if(f!=null){
			//是否为目录
			if (f.isDirectory()) {
				File[] fs = f.listFiles();
				if(fs!=null){
					//列出目录中文件
					for (int i = 0; i < fs.length; i++) {
						System.out.println(fs[i]);
					}
				}
			}else{
				System.out.println(f);
			}
		}
	}

}
